<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
    <title>快乐购1号店(周博)</title>
    <link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/head.css"/>
    <link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/footer.css"/>
   

    <!-- 自定义样式 -->
    
		<link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/head.css" />
		<link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/footer.css" 

/>
		<link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/iemt.css" 

/>



<script src="/Application/Home/Common/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript" charset="utf-8" src="/Application/Home/Common/js/jquery.countdown.js"></script>

<script type="text/javascript" charset="utf-8" src="/Public/utf8-php/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Public/utf8-php/ueditor.all.min.js"> </script>
     <script type="text/javascript" charset="utf-8" src="/Public/utf8-php/lang/zh-cn/zh-cn.js"></script>


  <?php echo hook('pageHeader');?>
</head>
<body>
	<!-- 头部 -->
	<div class="header">
    <!--顶部导航-->
      <div class="header_top">
        <div class="w1200">
          <div class="h_t_l">
        <?php if(is_login()): ?><div class="login_l">
                <span>
                欢迎<b class="caret"><?php echo get_username();?></b>来到快乐购!</span>
                    <a class="a_login" href="<?php echo U('User/profile');?>">[修改密码]</a>
                <span class="line"></span>
                <a class="" href="<?php echo U('User/logout');?>">[退出]</a>
            </div>
            <?php else: ?>
                <a class="a_login" href="<?php echo U('User/login');?>">[登录]</a>
                <span class="line"></span>
                <a class="" href="<?php echo U('User/register');?>">[注册]</a><?php endif; ?>
          </div>
          <div class="h_t_r">
            <ul>
              <li>
                <a href="">订单查询</a>
                <span class="line"></span>
              </li>
              <li>
                <a href="">我的快乐购</a>
                <span class="line"></span>
              </li>
              <li>
                <i class="tel_icon"></i>
                <a href="">400-705-1111</a>
                <span class="line"></span>
              </li>
              <li>
                <a href="">下载快乐购app</a>
                <div class="down_load">
                                    <div class="down_border">
                                        <b class="icon_top"></b>
                                        <img style="" src="/Application/Home/Common/image/down_load_20160411.png">
                                        <p>快乐生活 快乐购</p>
                                    </div>
                                </div>
                <span class="line"></span>
              </li>
              <li class="cus_c_box">
                <a href="">客服中心</a>
                <div class="cus_center">
                                    <a href="">帮助中心</a>
                                    <a href="">会员反馈</a>
                                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
        <!--搜索-->
        
	<!-- /头部 -->
	
	<!-- 主体 -->
	

	<div class="full_sc">
            <div class="w1200 header_conter">
              <div class="h_c_logo">
                <a href="index.html">
                  <img src="/Application/Home/Common/image/logo.jpg"/>
                </a>
              </div>
              <div class="h_c_bz">
                <img src="/Application/Home/Common/image/top_center.jpg" style="width: 467px;29px"/>
              </div>
              <div class="h_c_search">
                <div class="search_input">
                  <form action="<?php echo U('Index/sou');?>" method="post">
                    <input type="text" style="color: rgb(102, 102, 102);" name="name" class="text_search" placeholder="<?php echo ($sjsp['0']['name']); ?>" value="" />
                    <input type="submit" class="btn_search" value="搜索"/>
                  </form>
                </div>
                <div class="search_key">
                  <ul>
                  <?php if(is_array($sjsp)): $i = 0; $__LIST__ = $sjsp;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
                      <a href="<?php echo U('Index/iemt',array('gid'=>$vo['id']));?>"><?php echo (msubstr($vo["name"],0,8)); ?></a>
                    </li><?php endforeach; endif; else: echo "" ;endif; ?>
                  </ul>
                </div>
              </div>
              <div class="h_c_right">
                <a href="" class="h_c_r_car">
                  <b class="b_car1"></b>
                  <span onclick="javascript:window.open('/Home/Car/index')"><i class="ci-count"><?php echo ((isset($goshu) && ($goshu !== ""))?($goshu):'0'); ?></i>我的购物车</span>
                  <b class="b_car2"></b>
                </a>
              </div>
            </div>
          </div>
        <!--菜单-->
        <div class="full_nav">
          <div class="w1200">
            <ul class="nav">
              <li class="li_all_type">
                <a href="">全部分类</a>
                <b class="b_down"></b>
              </li>
              <li class="home">
                <a href="<?php echo U('Index/index');?>" style="color: #C41F3A;">首页</a>
              </li>
              <li>
                <a href="refined.html">精选品牌</a>
              </li>
              <li>
                <a href="go.html">全球购</a>
              </li>
              <li>
                <a href="<?php echo U('Index/brand');?>">品牌馆</a>
              </li>
            </ul>
          </div>
          </div>
    </div>

<div id="" class="">

        
           
        
        
		<div class="w1200">
			<!--分类导航-->
			<div class="top_nv">
	    		<span><a href="<?php echo U('Index/index');?>">首页</a></span>
	    		<span>></span>
	    		<span><a href="<?php echo U('Index/listlie',array('case'=>$res['1']['id']));?>"><?php echo ($res['1']['title']); ?></a></span>
	    		<span>></span>
	    		<span><a href="<?php echo U('Index/listlie',array('case'=>$res['2']['id']));?>"><?php echo ($res['2']['title']); ?></a></span>
	    	</div>
			<!--分类导航-->
			<div class="con_content">
				<!--提交区域-->
				<div class="con_top">
					<div class="con_top_l">
						<div class="tab-w">
							<!--放大镜-->
							<div class="divw">
								<a href="">
									<span class="zoomPad">
	    								<img id="midimg" src=""/>
	    								<div style="top: 148px; left: 153.5px; width: 180px; height: 180px; position: absolute; border-width: 1px; display: none;" class="zoomPup" ></div>
	    								<div style="position: absolute; z-index: 500; left: 370px; top: 1px; display: none;" class="zoomWindow">
	    									<div style="width: 380px;" class="zoomWrapper"><div style="width: 100%; position: absolute; display:none;" class="zoomWrapperTitle"></div>
	    									    <div style="position: relative;width: 100%; height: 380px;overflow: hidden; z-index:999;" class="zoomWrapperImage"><img src="/Uploads/<?php echo ($good["pic"]); ?>" style="position: absolute; border: 0px none; display: block;  top: 0px; width: 800px; height: 800px;">
	    									    </div>
	    									</div>
	    								</div>
	    							</span>
								</a>
								
							</div>
							<!--放大镜-->
							<!--tab,ajax-->
							<div class="box-tab">
								<div class="ul-w" id="imageMenu">
									<ul class="als-wrapper">
									<?php if(is_array($good['pic']) ==true): if(is_array($good['pic'])): $i = 0; $__LIST__ = $good['pic'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="als-item">

											<a href="javascipt:;"><img src="/Uploads/<?php echo ($v); ?>" /></a>
											
										</li><?php endforeach; endif; else: echo "" ;endif; ?>
										<?php else: ?>
										<li class="als-item">

											<a href="javascipt:;"><img src="/Uploads/<?php echo ($good['pic']); ?>" /></a>
											
										</li><?php endif; ?>
										
									</ul>
								</div>
								<div class="g_t_l_hd">
									<a href="javascript:;" class="btn l als-prev 
  disabled"></a>
									<a href="javascript:;" class="btn r als-next  "></a>
								</div>
							</div>
							<!--tab,ajax-->
						</div>
						<div class="detail_share">
							<div class="detail_sc">
								<i class="i_addsc"></i> 收藏商品
							</div>
						</div>
					</div>
					<form action="" method="post" id="iemt_form">
					<div class="con_top_r">
						<div class="detail_top">
						    
						    <input type="hidden" name="attrvid" id="attrvid" value="">
							<h1 class="detail_tit"><?php echo ($good["name"]); ?></h1>
							<h2 class="detail_tit_md"><?php echo ($good["des"]); ?></h2>
							<div class="price_wrap">
								<div class="detail_price">
								<b class="em_sign">￥</b>
									<span class="price_now">
	    								<?php echo ($good["mprice"]); ?>
	    							</span>
								</div>
								<div class="d_bh"><b>库存: 50件</b></div>
							</div>
							<div class="detail_freight">
								<span class="pop_tit ">运费：</span>
								<span id="freight" class="pop_black">包邮</span>
							</div>
							 
							<div class="detail_color">
							
							 <?php if(is_array($nicen)): $i = 0; $__LIST__ = $nicen;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$kk): $mod = ($i % 2 );++$i;?><div class="model_wrap color_wrap">
									<span class="pop_tit" name="key" value="<?php echo ($kk['id']); ?>"><?php echo ($kk['kname']); ?></span>
									<ul class="color_ul">
									  <?php if(is_array($kk["val"])): $i = 0; $__LIST__ = $kk["val"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$k): $mod = ($i % 2 );++$i;?><li class="no_kc">
											<a href="javascript:void(0)" name="attr<?php echo ($kk["id"]); ?>"  value="<?php echo ($k["id"]); ?>"><?php echo ($k["vname"]); ?></a>
											<b></b>
										</li><?php endforeach; endif; else: echo "" ;endif; ?>
										
									</ul>
								</div><?php endforeach; endif; else: echo "" ;endif; ?>

								<div class="model_wrap count_wrap">
									<span class="pop_tit">数量：</span>
									<div class="wrap_input">
										<a href="javascript://" data-param="0" class="btn-add">-</a>
										<a href="javascript://" data-param="0" class="btn-reduce">+</a>
										<input value="1" id="buy_num" class="text" onkeyup="this.value=this.value.replace(/\D/g, '');">
									</div>
								</div>
								<div class="model_wrap">
									<div class="model_submilt">
										<span class="btn_goods_remind from_gou" onclick="document.getElementById('iemt_form').submit();">立即购买</span>
										<span class="btn_goods_remind ajax_gou" >加入购物车</span>
									</div>
									<div class="detail_ewm">
										<p class="ewm_bg_img"></p>
										<p>
											<span class="fs_14">微信 支付宝</span>
											<span class="fs_14">直播商品订购减 20 元</span>
										</p>
									</div>
								</div>
							</div>
						</div>
					</div>
					</form>
				</div>
				<!--提交区域end-->
				<!--展示区域-->
				<div class="con_tab">
					<div class="con_nav">
						<div class="con_nav_c">
							<div class="w1200">
								<ul>
									<li class=""><a href="javascript:;">商品详情</a></li>
									<li><a href="javascript:;">商品参数</a></li>
									<li><a href="javascript:;">用户评价</a></li>
									<li><a href="javascript:;">为您推荐</a></li>
								</ul>
								<div class="fix_add_car">
									<div class="db_price">
										<em>¥</em>298.00
									</div>
									<a class="fixed_add_car" href="javascript:;">加入购物车</a>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="display">
					<div class="goods_box">
						<div class="detail_lists">
							<div class="d_h2">
								<h2>商品详情</h2>
							</div>
							<div class="detail_con">
								
								<div style="margin: auto;">
									<?php echo ($good["content"]); ?>
								</div>
								
							</div>
						</div>
					</div>
					
	    		    		   
	    		    		</div>
	    		    	</div>
	    		    </div>
				</div> --> -->
	    		<!--展示区域end-->
	    	</div>
	    </div>
	    
   
       
      <div class="fixed_dh">
        <div class="f_r_top">
          <div class="top_i" onclick="javascript:window.open('http://o.me/Home/User/index.html')">
              <i class="icon_user"></i>
             
              <span >账号</span>
            
          </div>
          <div class="f_line">
            <p class="f_line1"></p>
            <p class="f_line2"></p>
          </div>
          <div class="f_gwc">
            <a href="">
              <i class="icon_car"></i>
                <span>购物车</span>
                
            </a>
          </div>
          <div class="f_line">
            <p class="f_line1"></p>
            <p class="f_line2"></p>
          </div>
          <div class="top_i">
              <i class="icon_collect"></i>
              <span>收藏</span>
          </div>
        </div>
          <div class="f_bottom">
            <div class="f_sao">
              <div class="sao">
              <i class="ewm_img"></i>
              <div class="ewm_tc">
                    <div class="ewm_tc_bg">
                        <div class="down_app_icon"></div>
                        <img src="/Application/Home/Common/image/down_app_ewm.png">
                    </div>
              </div>
            </div>
            <div class="f_ke">
              <i class="online_cus"></i>
            </div>
            <div class="top_is">
              <a href="javascipt:;">
                <i class="retrun_top"></i>
              </a>
          </div>
          </div>
      </div>
      
</div>



<script type="text/javascript">
    $(function(){
        $(window).resize(function(){
            $("#main-container").css("min-height", $(window).height() - 343);
        }).resize();
    })
</script>
	<!-- /主体 -->

	<!-- 底部 -->
	<div class="footer">
        <div class="footer_b w1200"><img src="/Application/Home/Common/image/foot_img1.jpg"/></div>
        <div class="footer_help w1200">
          <div class="footer1_l">
            <dl class="helpDl">
              <dt><h5>使用帮助</h5></dt>
              <dd><a href="">税费收取规则 </a></dd>
              <dd><a href="">新手指南 </a></dd>
                <dd><a href="">常见问题 </a></dd>
              <dd><a href="">用户协议 </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>会员服务</h5></dt>
              <dd><a href="">积分政策  </a></dd>
              <dd><a href="">会员权益  </a></dd>
                <dd><a href="">会员等级  </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>支付方式</h5></dt>
              <dd><a href="">积分支付  </a></dd>
              <dd><a href="">货到付款  </a></dd>
                <dd><a href="">在线支付  </a></dd>
              <dd><a href="">优惠券支付  </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>配送方式</h5></dt>
              <dd><a href="">包邮政策   </a></dd>
              <dd><a href="">费用说明   </a></dd>
                <dd><a href="">配送说明   </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>售后服务</h5></dt>
              <dd><a href="">电子发票   </a></dd>
              <dd><a href="">售后咨询   </a></dd>
                <dd><a href="">退货办理   </a></dd>
              <dd><a href="">退货政策   </a></dd>
            </dl>
          </div>
          <div class="footer1_r">
            <ul>
              <li>
                <h2>手机快乐购</h2>
                <img src="/Application/Home/Common/image/footer_ewm_01.png"/>
                <p>下载移动客户端</p>
              </li>
              <li>
                <h2>快乐购微信</h2>
                <img src="/Application/Home/Common/image/footer_ewm_02.png"/>
                            <p>快乐购官方微信</p>
              </li>
            </ul>
          </div>
        </div>
          <div class="footer_nav">
            <div class="w720">
              <ul>
                <li>
                  <a href="">关于快乐购 </a>
                  <span class="line"></span>
                </li>
                <li>
                  <a href="">投资者关系 </a>
                  <span class="line"></span>
                </li>
                <li>
                  <a href="">商家入驻  </a>
                  <span class="line"></span>
                </li>
                <li>
                  <a href="">联系我们 </a>
                  <span class="line"></span>
                </li>
              </ul>
            </div>
          </div>
          <div class="footer_bottom">
            <div class="w1200">
              <p>
                <span class="font_arial">Copyright© 2006-2016 happigo. All Rights Reserved </span>
                                           免费服务热线: 400-705-1111 | 固话也可拨打: 800-705-1111
                        <span class="font_arial">E-Mail: service@happigo.com</span><br>
                                           湘ICP备12000157号 信息网络传播视听节目许可证号：1810530
              </p>
              <p class="footer_b">
                <a href="http://www.itrust.org.cn/home/index/itrust_certifi/wm/2782875193.html">
                  <img src="/Application/Home/Common/image/foot_img3.png"/>
                </a>
                <a href="https://search.szfw.org/cert/l/CX20150428007576007720">
                  <img src="/Application/Home/Common/image/foot_img4.png"/>
                </a>
              </p>
            </div>
          </div>
      </div>


    <script type="text/javascript">
(function(){
	var ThinkPHP = window.Think = {
		"ROOT"   : "", //当前网站地址
		"APP"    : "", //当前项目地址
		"PUBLIC" : "/Public", //项目公共目录地址
		"DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
		"MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
		"VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
	}
})();
</script>
  

		<script src="/Application/Home/Common/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>

		<script type="text/javascript">
		    $(function(){
		    	// $(".color_ul li").eq('0').addClass("on");
		    	//添加一个点击事件
		    	$(".color_ul li").click(function(){
		    		//切换颜色
		    		$(this).addClass("on").siblings().removeClass("on");
		    	});
		    	//添加商品数量
		    	$(".wrap_input .btn-add").click(function(){
		    		//获得input值
		    		var y = $("#buy_num").val();
		    		//转整
		    		x = parseInt(y)+1;
		    		$("#buy_num").val(x); 
		    		
		    	});
		    	//添加商品数量
		    	$(".wrap_input .btn-reduce").click(function(){
		    		//获得input值
		    		var y = $("#buy_num").val();
		    		//转整
		    		x = parseInt(y)-1;
		    		if(x>0){
		    		   $("#buy_num").val(x); 
		    		}
		    		
		    	});
		    });
		</script>
        <script type="text/javascript">
      $(document).ready(function(){
	// 图片上下滚动
	var count = $("#imageMenu ul li").length - 5; /* 显示 6 个 li标签内容 */
	var interval = $("#imageMenu ul li:first").width();
	var curIndex = 0;
	$("#midimg").attr("src");
	$('.scrollbutton').click(function(){
		if( $(this).hasClass('disabled') ) return false;
		
		if ($(this).hasClass('als-prev')) --curIndex;
		else ++curIndex;
		
		$('.btn').removeClass('disabled');
		if (curIndex == 0) $('.als-prev').addClass('disabled');
		if (curIndex == count-1) $('.als-next').addClass('disabled');
		
		$("#imageMenu ul ").stop(false, true).animate({"marginLeft" : -curIndex*interval + "px"}, 600);
	});
});


      // 解决 ie6 select框 问题
	$.fn.decorateIframe = function(options) {
        if ($.browser.msie && $.browser.version < 7) {
            var opts = $.extend({}, $.fn.decorateIframe.defaults, options);
            $(this).each(function() {
                var $myThis = $(this);
                //创建一个IFRAME
                var divIframe = $("<iframe />");
                divIframe.attr("id", opts.iframeId);
                divIframe.css("position", "absolute");
                divIframe.css("display", "none");
                divIframe.css("display", "block");
                divIframe.css("z-index", opts.iframeZIndex);
                divIframe.css("border");
                divIframe.css("top", "0");
                divIframe.css("left", "0");
                if (opts.width == 0) {
                    divIframe.css("width", $myThis.width() + parseInt($myThis.css("padding")) * 2 + "px");
                }
                if (opts.height == 0) {
                    divIframe.css("height", $myThis.height() + parseInt($myThis.css("padding")) * 2 + "px");
                }
                divIframe.css("filter", "mask(color=#fff)");
                $myThis.append(divIframe);
            });
        }
    }

    $.fn.decorateIframe.defaults = {
        iframeId: "decorateIframe1",
        iframeZIndex: -1,
        width: 0,
        height: 0
    }
    //放大镜视窗
    $(".zoomWindow").decorateIframe();

    //点击到中图
    var midChangeHandler = null;
    $("#imageMenu ul li img").bind("click", function(){
		if ($(this).attr("id") != "onlickImg") {
			midChange($(this).attr("src"));
			$("#imageMenu li").removeAttr("id");
			$(this).parent().attr("id", "onlickImg");
		}
	}).bind("mouseover", function(){
		if ($(this).attr("id") != "onlickImg") {
			window.clearTimeout(midChangeHandler);
			midChange($(this).attr("src"));
			$(this).css({ "border": "3px solid #959595" });
		}
	}).bind("mouseout", function(){
		if($(this).attr("id") != "onlickImg"){
			$(this).removeAttr("style");
			midChangeHandler = window.setTimeout(function(){
				midChange($("#onlickImg img").attr("src"));
			}, 1000);
		}
	});

    function midChange(src) {
        $("#midimg").attr("src", src).load(function() {
            changeViewImg();
        });
    }
    

    //大视窗看图
    function mouseover(e) {
        if ($(".zoomPup").css("display") == "none") {
            $(".zoomPup,.zoomWindow").show();
        }

        $(".zoomPup").css(fixedPosition(e));
        e.stopPropagation();
    }


    function mouseOut(e) {
        if ($(".zoomPup").css("display") != "none") {
            $(".zoomPup,.zoomWindow").hide();
        }
        e.stopPropagation();
    }
    
    
    $("#midimg").mouseover(mouseover); //中图事件
    $("#midimg,.zoomPup").mousemove(mouseover).mouseout(mouseOut); //选择器事件

    var $divWidth = $(".zoomPup").width(); //选择器宽度
    var $divHeight = $(".zoomPup").height(); //选择器高度
    var $imgWidth = $("#midimg").width(); //中图宽度
    var $imgHeight = $("#midimg").height(); //中图高度
    var $viewImgWidth = $viewImgHeight = $height = null; //IE加载后才能得到 大图宽度 大图高度 大图视窗高度

    function changeViewImg() {
        $(".zoomWindow img").attr("src", $("#midimg").attr("src"));
    }

    changeViewImg();

    $(".zoomWindow").scrollLeft(0).scrollTop(0);
    function fixedPosition(e) {
        if (e == null) {
            return;
        }
        var $imgLeft = $("#midimg").offset().left; //中图左边距
        var $imgTop = $("#midimg").offset().top; //中图上边距
        X = e.pageX - $imgLeft - $divWidth / 2; //selector顶点坐标 X
        Y = e.pageY - $imgTop - $divHeight / 2; //selector顶点坐标 Y
        X = X < 0 ? 0 : X;
        Y = Y < 0 ? 0 : Y;
        X = X + $divWidth > $imgWidth ? $imgWidth - $divWidth : X;
        Y = Y + $divHeight > $imgHeight ? $imgHeight - $divHeight : Y;

        if ($viewImgWidth == null) {
            $viewImgWidth = $(".zoomWindow img").outerWidth();
            $viewImgHeight = $(".zoomWindow img").height();
            if ($viewImgWidth < 200 || $viewImgHeight < 200) {
                $viewImgWidth = $viewImgHeight = 800;
            }
            $height = $divHeight * $viewImgHeight / $imgHeight;
            $(".zoomWindow").width($divWidth * $viewImgWidth / $imgWidth);
            $(".zoomWindow").height($height);
        }

        var scrollX = X * $viewImgWidth / $imgWidth;
        var scrollY = Y * $viewImgHeight / $imgHeight;
        $(".zoomWindow img").css({ "left": scrollX * -1, "top": scrollY * -1 });
        $(".zoomWindow").css({ "top": 0, "left": $(".divw").offset().left + $(".divw").width()-30 });

        return { left: X, top: Y };
    }

    
	</script>
		
		<script type="text/javascript">
			$(function(){
				$(".no_kc").click(function(){
					var gid =<?php echo ($good["id"]); ?>;
					var attr = new Array();
					$(".on a").each(function(a,el){
						attr.push($(el).attr('value'));
					});

					attr.sort(function(a,b){
						return a-b;
					});
					// console.log(attr);
					$.post("<?php echo U('Index/price');?>", { attr: attr, gid: gid },
						function(data){
							if (data.status == 1) {
								$(".price_now").empty().append(data['info']['mprice']);
								$(".d_bh").empty().append("<b>库存:"+data['info']['num']+"件</b>");
								$("#attrvid").attr('value',data['info']['attrvid']);
							}
						});
				});
			});
		</script>
		<script type="text/javascript">
		$(function(){
		$('.ajax_gou').click(function(){
                var gid=<?php echo ($good['id']); ?>;
                var num=$('#buy_num').val();
                var attrvid=$('#attrvid').attr('value');
                var r = /^[0-9]*[1-9][0-9]*$/;
                if(!r.test(num)){
                    alert('购买数量必须为正整数');
                }    
        $.post("<?php echo U('Car/add');?>",{gid:gid,num:num,attrvid:attrvid},
           function(data){
               alert(data.info);
           });
        });
    });
</script>
		 <!-- 用于加载js代码 -->
<!-- 页面footer钩子，一般用于加载插件JS文件和JS代码 -->
<?php echo hook('pageFooter', 'widget');?>
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
  
</div>
	<!-- /底部 -->
</body>
</html>